import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:my_app/app/routes/pages.dart';
import 'package:my_app/app/core/theme/app_colors.dart';
import 'package:my_app/app/widgets/cell/custom_tile_widget.dart';

/// component_page.dart
///
/// Created by fuchuanwei on Tue Feb 21 2023.
///
/// Description: 组件页面
///
class ComponentPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('组件')),
      body: ListView(
        children: [
          CustomTileWidget(
            title: '图片',
            subTitle: "自定义图片组件，支持占位符和网络图片淡入,网络图片自动缓存,点击图片可预览",
            assetImageName: "assets/images/image.png",
            onTap: () => Get.toNamed(Routes.IMAGE_WIDGET),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'ExpandableFab',
            subTitle: "一个点击展开的 FAB",
            assetImageName: "assets/images/expandable_fab.png",
            onTap: () => Get.toNamed(Routes.EXPANDABLE_FAB),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'Smart Dialog',
            subTitle: "优秀的对话框组件,可以解决各种应用场景",
            assetImageName: "assets/images/dialog.png",
            onTap: () => Get.toNamed(Routes.DIALOG),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'Picker',
            subTitle: "各种类型的选择器",
            assetImageName: "assets/images/picker.png",
            onTap: () => Get.toNamed(Routes.PICKER),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'Cell',
            subTitle: "cell单元格一般用于一组列表的情况，比如个人中心页，设置页等",
            assetImageName: "assets/images/cell.png",
            onTap: () => Get.toNamed(Routes.CELL),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'Empty内容为空',
            subTitle: "用于需要加载内容，但是加载的第一页数据就为空，提示一个\"没有内容\"的场景",
            assetImageName: "assets/images/empty.png",
            onTap: () => Get.toNamed(Routes.EMPTY),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          ),
          CustomTileWidget(
            title: 'Tag',
            subTitle: "Tag组件一般用于标记和选择",
            assetImageName: "assets/images/tag.png",
            onTap: () => Get.toNamed(Routes.TAG),
          ),
          Divider(
            height: 2,
            color: dividerColor,
            thickness: 0.5,
          )
        ],
      ),
    );
  }
}
